package com.example.demo.controller;

import com.example.demo.service.BookPressService;
import com.example.demo.service.impl.BookNameServiceImpl;
import com.example.demo.service.impl.BookPressServiceImpl;
import com.example.demo.service.impl.FileServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Classname IndexController
 * @Description TODO
 * @Date 2020/12/28 9:50
 * @Created by 新
 */
@Controller
public class IndexController {
    private final static Logger logger = LoggerFactory.getLogger(IndexController.class);
    @Autowired
    FileServiceImpl fileService;
    @Autowired
    BookPressServiceImpl bookPressService;
    @Autowired
    BookNameServiceImpl bookNameService;

    @RequestMapping({"/", "/index"})
    public String toIndex(Model model) {
        logger.info("首页 index");
        model.addAttribute("fileList",fileService.getFileList());
        return "index";
    }
}
